﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;

public enum ModarType
{
    CampaignStart

}

namespace ProjectNocturnalFool
{
    class ModarWindow : UserControl
    {
        private ModarType _modarType;
        public ModarType modarType
        {
            get { return _modarType; }
            set
            {
                _modarType = value;
                loadModar();
            }
        }


        public override void LoadContent()
        {
            base.LoadContent();

            bgTexture = TacticsGame.Instance.Content.Load<Texture2D>(Constants.TextureButtonRegular);
            depth = ControlDepth.Modar;

            width = Constants.ModarWidth;
            height = Constants.ModarHeight;
        }

        /// <summary>
        /// Draws the window on screen
        /// </summary>
        /// <param name="gameTime"></param>
        public override void Draw(GameTime gameTime)
        {
            base.Draw(gameTime);

            TacticsGame.Instance.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.Default, RasterizerState.CullNone);

                        Rectangle targetRect = new Rectangle(x, y, width, height);
            TacticsGame.Instance.spriteBatch.Draw(bgTexture,
                                                      targetRect, null,
                                                      Color.White,
                                                      0,
                                                      Vector2.Zero,
                                                      SpriteEffects.None,
                                                      0);
            TacticsGame.Instance.spriteBatch.End();
        }

        /// <summary>
        /// Auto sets modar of the window
        /// </summary>
        public ModarWindow ()
            : base()
            {
                modar = true;
            }

        /// <summary>
        /// Loads controls onto window based on type
        /// Also clears previous controls
        /// Only is called when modarType is changed
        /// </summary>
        private void loadModar()
        {
            controls.Clear();

            switch (modarType)
            {
                case ModarType.CampaignStart:

                default:

                    break;
            }

        }
    }
}
